
import { BUTTONID } from '../../constance';
import searchBtnClick from './searchBtnClick';
import refreshBtnClick from './refreshBtnClick';
import deleteBtnClick from './deleteBtnClick';
import addBtnClick from './addBtnClick';
import editBtnClick from './editBtnClick';
import copyBtnClick from './copyBtnClick';
import VoucherClick from './VoucherClick';
import RedHandleClick from './RedHandleClick';
import batchBlueBtnClick from './batchBlueBtnClick';

function buttonClick(props, id, text,  record, index) {
        switch (id) {
                case BUTTONID.Add:
                        addBtnClick.call(this, props);
                        break;
                case BUTTONID.Edit:
                        editBtnClick.call(this, props, record, index);
                        break;
                case BUTTONID.Delete:
                        deleteBtnClick.call(this, props, record, index);
                        break;
                case BUTTONID.Copy:
                        copyBtnClick.call(this, props, record, index);
                        break;
                case BUTTONID.Refresh:
                        refreshBtnClick.call(this, props);
                        break;
                case BUTTONID.batchBlueBtn:
                        batchBlueBtnClick.call(this, props);
                        break;
                case BUTTONID.Voucher:
                        VoucherClick.call(this, props, record, index);
                        break;
                case BUTTONID.RedHandle:
                        RedHandleClick.call(this, props, record, index);
                        break;
        }
}

export { buttonClick, searchBtnClick };
